package com.xszx.knowledge.service.impl;

import com.xszx.knowledge.dto.StatisticDTO;
import com.xszx.knowledge.entity.EbookSnapshot;
import com.xszx.knowledge.mapper.EbookSnapshotMapper;
import com.xszx.knowledge.service.EbookSnapshotService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 电子书快照表 服务实现类
 * </p>
 *
 * @author wencai
 * @since 2023/05/06 14:13
 */
@Service
public class EbookSnapshotServiceImpl extends ServiceImpl<EbookSnapshotMapper, EbookSnapshot> implements EbookSnapshotService {
    @Resource
    private EbookSnapshotMapper ebookSnapshotMapper;
    @Override
    public void initStatistic(){
        ebookSnapshotMapper.initStatistic();
    }

    @Override
    public List<StatisticDTO> getTopStatistic() {
        return ebookSnapshotMapper.findTopStatistic();
    }

    @Override
    public List<StatisticDTO> getThirtyStatistic() {
        return ebookSnapshotMapper.findThirtyStatistic();
    }
}
